package com.silvervine.macnets.utils;

public class Tunnelcfg {
    private String prefix      = "";
    private String domain      = "app";
    private String comment     = "client from android";
    private String svrAddr     = "www.macnets.cn:7885";
    private String addr        = "www.macnets.cn:443";
    private String sandboxPath = "";

    private String user = "";
    private String pass = "";

    public String getSandboxPath() {
        return sandboxPath;
    }

    public Tunnelcfg sandboxPath(String sandboxPath) {
        this.sandboxPath = sandboxPath;
        return this;
    }

    public Tunnelcfg prefix(String prefix) {
        this.prefix = prefix;
        return this;
    }

    public Tunnelcfg domain(String domain) {
        this.domain = domain;
        return this;
    }

    public Tunnelcfg comment(String comment) {
        this.comment = comment;
        return this;
    }

    public Tunnelcfg svrAddr(String svrAddr) {
        this.svrAddr = svrAddr;
        return this;
    }

    public Tunnelcfg addr(String addr) {
        this.addr = addr;
        return this;
    }

    public Tunnelcfg user(String user) {
        this.user = user;
        return this;
    }

    public Tunnelcfg pass(String pass) {
        this.pass = pass;
        return this;
    }

    public Tunnelcfg(String user) {
        this.user = user;
    }

    @Override
    public String toString() {
        //String defaultCharsetName=Charset.defaultCharset().displayName();
        //System.out.println(defaultCharsetName);
//		return "(RelayList){\r\n" + "  (Relay0){\r\n" + "    (Type){0}\r\n" + "    (Addr){"+this.addr+"}\r\n"
//				+ "  }\r\n" + "} \r\n" + "\r\n" + "(ModeClient){\r\n" + "  (Base){\r\n" + "    (MaxSess){256}\r\n"
//				+ "    (MaxHttp){8}\r\n" + "    (MaxTunnel){16}\r\n" + "    (ConnectTimeout){30}\r\n"
//				+ "    (SessBufSize){128}\r\n" + "    (P2PTryTime){5}\r\n" + "  }\r\n" + "  (Node){\r\n"
//				+ "    (SvrAddr){"+this.svrAddr+"}\r\n" + "    (CltAddr){0:0:0:127.0.0.1:0:0}\r\n"
//				+ "    (SvrName){pgTunnelSvr0}\r\n" + "  }\r\n" + "  (AccountCode){\r\n" + "    (Prefix){"+this.prefix+"}\r\n"
//				+ "    (Domain){"+this.domain+"}\r\n" + "    (Comment){"+this.comment+"}\r\n" + "  }\r\n" + "  (Log){\r\n"
//				+ "    (Level0){1}\r\n" + "    (Level1){1}\r\n" + "    (Level2){1}\r\n" + "    (Level3){1}\r\n"
//				+ "  }\r\n" + "  (Utilize){\r\n" + "    (ForwardSpeed){327680}\r\n" + "    (TunnelKillPort){1}\r\n"
//				+ "  }\r\n" + "}\r\n"+"(Home){"+this.sandboxPath+"}";
        return "(RelayList){\r\n" + "  (Relay0){\r\n" + "    (Type){0}\r\n" + "    (Addr){" + this.addr + "}\r\n"
                + "  }\r\n" + "} \r\n" + "\r\n" + "(ModeClient){\r\n" + "  (Base){\r\n" + "    (MaxSess){256}\r\n"
                + "    (MaxHttp){8}\r\n" + "    (MaxTunnel){16}\r\n" + "    (ConnectTimeout){30}\r\n"
                + "    (SessBufSize){128}\r\n" + "    (P2PTryTime){5}\r\n" + "  }\r\n" + "  (Node){\r\n"
                + "    (SvrAddr){" + this.svrAddr + "}\r\n" + "    (CltAddr){0:0:0:127.0.0.1:0:0}\r\n"
                + "    (SvrName){pgTunnelSvr0}\r\n" + "  }\r\n" + "  (AccountPass){\r\n" + "    (User){" + this.user + "}\r\n"
                + "    (Pass){" + this.pass + "}\r\n" + "    (Comment){" + this.comment + "}\r\n" + "  }\r\n" + "  (Log){\r\n"
                + "    (Level0){1}\r\n" + "    (Level1){1}\r\n" + "    (Level2){1}\r\n" + "    (Level3){1}\r\n"
                + "  }\r\n" + "  (Utilize){\r\n" + "    (ForwardSpeed){327680}\r\n" + "    (TunnelKillPort){1}\r\n"
                + "  }\r\n" + "}\r\n" + "(Home){" + this.sandboxPath + "}";
    }

}
